﻿using System;
namespace Kis.Xroad.Eu {
    
    
    [System.SerializableAttribute()]
    public class WorkDay : global::Xtee.Core.Schema.XsdString {
        
        public const string MONDAY = "Monday";
        
        public const string TUESDAY = "Tuesday";
        
        public const string WEDNESDAY = "Wednesday";
        
        public const string THURSDAY = "Thursday";
        
        public const string FRIDAY = "Friday";
        
        public const string SATURDAY = "Saturday";
        
        public const string SUNDAY = "Sunday";
        
        public WorkDay(string value) : 
                base(value) {
            this.Validate();
            string annot = null;
            if (Value == "Monday") {
                annot = "Monday";
            }
            if (Value == "Tuesday") {
                annot = "Tuesday";
            }
            if (Value == "Wednesday") {
                annot = "Wednesday";
            }
            if (Value == "Thursday") {
                annot = "Thursday";
            }
            if (Value == "Friday") {
                annot = "Friday";
            }
            if (Value == "Saturday") {
                annot = "Saturday";
            }
            if (Value == "Sunday") {
                annot = "Sunday";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public WorkDay() : 
                base(string.Empty) {
        }
        
        public static bool TryParse(string value, out global::Kis.Xroad.Eu.WorkDay result) {
            try {
                result = new global::Kis.Xroad.Eu.WorkDay(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator String (WorkDay value) {
            return value.Value;
        }
        
        public static implicit operator WorkDay (string value) {
            if (value==null) {
                return null;
            }
            return new WorkDay(value);
        }
    }
}
